import { and, eq, inArray, like, SQL, sql } from 'drizzle-orm';
import type { SQLWrapper } from 'drizzle-orm';
import { db } from '~~/server/utils/db'
import { systemUser } from '~~/server/db/schema';

export const getAllUsers = async () => {
    const result = await db.query.systemUser.findMany()
    return result
}
export const addUser = async (username: string) => {
    const result = await db.insert(systemUser).values({
        username
    }).returning({ id: systemUser.id })
    return result[0].id
}
export const byId = async (id: number) => {
    return await db.query.systemUser.findFirst({
        where: eq(systemUser.id, id),
    })
}
export const hello = async () => {
    console.log('hello');

}